var gulp = require('gulp');
// var less = require('gulp-less');
// var path = require('path');
var browserSync = require('browser-sync').create();

// gulp.task('less', function () {
//   return gulp.src('./less/main.less')
//     .pipe(less({
//       paths: [ path.join(__dirname, 'less') ]
//     }))
//     .pipe(gulp.dest('./css/main.css'));
// });

gulp.task('serve', function() {
    browserSync.init({
        proxy: "http://localhost/wei8000/web/app_dev.php"
    });

    gulp.watch('./css/*.css').on('change', browserSync.reload);
    gulp.watch('./TopxiaWebBundle/views/Default/*.twig').on('change', browserSync.reload);
});

gulp.task('default', ['less', 'serve'], function () {
	console.log('服务器已经启动，正在监测文件变化……');
});